//
// Created by Zhangwj on 2023/9/25.
//

#ifndef COMPILE_TASK2_PARSER_H
#define COMPILE_TASK2_PARSER_H


#include <vector>
#include "Lexer.h"
#include "ParseNodes/CompUnitNode.h"
#include "ParseNodes/DeclNode.h"

class Parser {
public:
    explicit Parser(std::vector<std::tuple<LexType, std::string>> tokens_);

    void next();

    LexType getLexType(int i);

    std::string getString(int i);

    static Parser parser;


private:
    std::vector<std::tuple<LexType, std::string>> tokens;
    size_t pos;
};


#endif //COMPILE_TASK2_PARSER_H
